<!-- 主界面 -->
<div class="main">
	
	<!-- 工具栏 -->
	<div class="toolbar">
		<button open="{area:'365px', offset:'139px'}" url="/admin/role/add" class="btn btn-success btn-sm">
			<i class="fa fa-plus mr-1"></i>创建
		</button>
	</div>
	
	<!-- 表格容器 -->
	<div id="table-box" class="table-box">
		
		<table class="table table-hover">
			
			<thead>
				<tr>
					<th>id</th>
					<th>名称</th>
					<th>备注</th>
					<th>创建时间</th>
					<th class="operation">操作</th>
				</tr>
			</thead>
			
			<tbody>
			#for (x : page.getList())
				<tr>
					<td>#(x.id)</td>
					<td>#(x.name)</td>
					<td>#(x.remark)</td>
					<td>#date(x.created)</td>
					
					<td class="operation">
						<a open="{area:'430px', offset:'139px'}" url="/admin/role/edit?id=#(x.id)&pn=#(page.pageNumber)">修改</a> |
						<a fill pushState="false" url="/admin/role/assignPermissions?id=#(x.id)">分配权限</a> |
						
						### 这里用 url 代替 href 是为了防止意外删除数据
						<a confirm="确定删除 #escape(x.name) ？" ok-remove="tr" url="/admin/role/delete?id=#(x.id)">删除</a>
					</td>
				</tr>
			#end
			</tbody>
			
		</table>
	</div>
	
	<!-- 分页 -->
	### 将 keyword 放入 append，促使分页链接中追加该参数用于搜索
	#set(append = keyword ? '&keyword=' + keyword : '')
	#@adminPaginate(page, "/admin/role?pn=")
	
</div>




